package demo4;

public class Test {

    public static void main(String[] args) {
        Dog dog1=new Dog("旺财",11);
        Dog dog2=new Dog("旺财",11);
        System.out.println(dog1==dog2);
        System.out.println(dog1.equals(dog2));
        System.out.println(dog1.hashCode());
        System.out.println(dog2.hashCode());
    }

    public static void run(IRunning iRunning){
        iRunning.Running();
    }
    public static void fly(IFly iFly){
        iFly.fly();
    }
    public static void swim(ISwimming iSwimming){
        iSwimming.swim();
    }
    public static void func1(Animal animal){
        animal.eat();
    }
    public static void main1(String[] args) {
        func1(new Dog("旺财",1));
        func1(new Duck("鸭子",4));
        func1(new Fish("小鱼",5));
        run(new Dog("wangcai",22));
        fly(new Duck("uuu",25));
        swim(new Fish("zzz",44));
    }
}
